﻿<Window x:Class="SolickManagerV3_4.Windows.AuthorizationWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:SolickManagerV3_4.Windows"
        mc:Ignorable="d"
        WindowStartupLocation="CenterScreen"
        Icon="Images/SolulCompIcon.ico"
        Title="SoulComp Manager" MinHeight="720" MinWidth="1280"
        MaxHeight="1080" MaxWidth="1920">
    <Grid Background="#FAFAFA">
        <Border Visibility="{Binding Authorization}" VerticalAlignment="Center" HorizontalAlignment="Center" Width="350" Height="400" CornerRadius="10" Background="#17c3b2">
            <StackPanel >
                <Label Content="Авторизация" Width="154" FontSize="24" HorizontalAlignment="Center" Margin="0 10 0 0" Foreground="#F5F5F5" FontFamily="Inter/#Inter-V.ttf"/>
                <Grid Width="310" HorizontalAlignment="Center" Margin="0 28 0 0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="auto"/>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition  />
                        <RowDefinition/>
                    </Grid.RowDefinitions>
                    <Label Content="Логин:" Grid.Row="0" Foreground="#F5F5F5" FontFamily="Inter/#Inter-V.ttf" FontSize="20" Margin="0 0 0 10"/>
                    <Label Content="Пароль:" Grid.Row="1" Foreground="#F5F5F5" FontFamily="Inter/#Inter-V.ttf" FontSize="20"/>

                    <Border  Grid.Column="1" Grid.Row="0" CornerRadius="5" Height="30" Width="200" HorizontalAlignment="Right" Background="#FAFAFA" Margin="0 0 0 10">
                        <TextBox Style="{DynamicResource RoundTextBox}" Text="{Binding Login}" FontSize="16" />
                    </Border>
                    <Border  Grid.Column="1" Grid.Row="1" CornerRadius="5" Height="30" Width="200"  HorizontalAlignment="Right" Background="#FAFAFA">
                        <PasswordBox Style="{DynamicResource RoundPasswordBox}"  x:Name="passbox" FontSize="16"/>
                    </Border>
                </Grid>

                <Label Visibility="{Binding NotVerifyVisibility}" Content="Неправильно введён логин или пароль!" Width="270" Height="24" FontSize="14" Foreground="#DA2C38" FontFamily="Inter/#Inter-V.ttf" HorizontalAlignment="Center" Margin="0 14"/>

                <Border Visibility="{Binding NotVerifyVisibility}" CornerRadius="10" Background="#FAFAFA" Width="270" Height="110">
                    <StackPanel>
                        <Label Content="Введите капчу:" FontFamily="Inter/#Inter-V.ttf" FontSize="14" Width="120" Height="26" VerticalAlignment="Top" HorizontalAlignment="Left"/>
                        <Border Width="150" Height="45" CornerRadius="5" Background="#FFF" BorderBrush="#3993DD" Margin="0 5 0 8"  BorderThickness="1">
                            <StackPanel Width="150" Height="45">
                                <Canvas Name="captchCanvas" Width="150" Height="45"/>
                            </StackPanel>
                        </Border>
                        <TextBox Width="240" Height="20"  Style="{DynamicResource RoundTextBox}" BorderThickness="1" BorderBrush="#3993DD" Margin="0 0 0 6" Text="{Binding CaptchaVerify}" FontSize="14" VerticalAlignment="Center"/>
                    </StackPanel>
                </Border>

                <Border CornerRadius="5" Width="300" Height="30"  Margin="0 34 0 18" Background="#FAFAFA">
                    <Button Style="{DynamicResource ButtonRoundStyle}"  BorderThickness="0"  Content="Войти" FontFamily="Inter/#Inter-V.ttf" FontSize="20" Background="#FAFAFA" Click="VerifyClick"/>
                </Border>
            </StackPanel>
        </Border>
        <Grid Visibility="{Binding Loading}" VerticalAlignment="Center" HorizontalAlignment="Center" Width="350" Height="300">
            <Grid.RowDefinitions>
                <RowDefinition Height="200"/>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <Image Source="/Windows/Images/LoadingBackGround.png"/>
            <Image Source="/Windows/Images/LoadingKrutVert.png" Width="187">
                <Image.RenderTransform>
                    <RotateTransform x:Name="rotate"
                         CenterX="93.5"
                         CenterY="82.34"/>
                </Image.RenderTransform>
                <Image.Triggers>
                    <EventTrigger RoutedEvent="Loaded">
                        <BeginStoryboard>
                            <Storyboard RepeatBehavior="Forever">
                                <DoubleAnimation Storyboard.TargetName="rotate"
                                     Storyboard.TargetProperty="Angle"
                                     By="360" Duration="0:0:1"/>
                            </Storyboard>
                        </BeginStoryboard>
                    </EventTrigger>
                </Image.Triggers>
            </Image>

            <ProgressBar x:Name="progressbar" Style="{DynamicResource ProgressBarRound}" Value="{Binding ProgressLoading}" Minimum="0" Maximum="100"  Grid.Row="1" Height="20" />
        </Grid>

    </Grid>
</Window>
